<?php

header('Content-Type: application/json; charset=utf-8');

include 'conexion.php';

$sql = "SELECT * FROM `peliculas`";
$resulset = mysql_query($sql);
$rows = array();
while ($row = mysql_fetch_assoc($resulset)) {
    $rows[] = array_map('utf8_encode', $row); 
}

echo json_encode($rows);
?>